﻿#region

using System;
using System.Collections.Generic;
using MediaSage.Lib.Configuration;
using MediaSage.Lib.Database;
using MediaSage.Lib.Plugin;
using MediaSage.Lib.ThreadManager;
using MediaSage.Lib.Utilities;
using Microsoft.VisualStudio.TestTools.UnitTesting;

#endregion

namespace MediaSageLibTest
{
    ///<summary>
    ///    This is a test class for ThreadManagerTest and is intended
    ///    to contain all ThreadManagerTest Unit Tests
    ///</summary>
    [TestClass]
    public class ThreadManagerTest
    {
        ///<summary>
        ///    Gets or sets the test context which provides
        ///    information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext { get; set; }

        #region Additional test attributes

        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //

        #endregion

        ///<summary>
        ///    A test for CreateImageUpdateThread
        ///</summary>
        [TestMethod]
        public void CreateImageUpdateThreadTest()
        {
            Config Configuration = new Config();
            ThreadManager target = Configuration.ThreadManager;
            ImageEntity ImageEnt = new ImageEntity();
            ImageEnt.URL = @"http://s.imwx.com/v.20111012.090711//img/layout/TWC_logo_84x84.gif";
            Guid results = target.CreateImageUpdateThread(ImageEnt);
            List<Guid> Items = new List<Guid>();
            Items.Add(results);
            target.WaitForResults(Items);
            DBUtil.GetSession().Refresh(ImageEnt);
        }

        ///<summary>
        ///    A test for CreateMaintenanceThread
        ///</summary>
        [TestMethod]
        public void CreateMaintenanceThreadTest()
        {
            Config Configuration = null; // TODO: Initialize to an appropriate value
            ThreadManager target = new ThreadManager(Configuration); // TODO: Initialize to an appropriate value
            PluginBase provider = null; // TODO: Initialize to an appropriate value
            Guid expected = new Guid(); // TODO: Initialize to an appropriate value
            Guid actual;
            actual = target.CreateMaintenanceThread(provider);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        ///<summary>
        ///    A test for CreateUpdateThread
        ///</summary>
        [TestMethod]
        public void CreateUpdateThreadTest()
        {
            Config Configuration = null; // TODO: Initialize to an appropriate value
            ThreadManager target = new ThreadManager(Configuration); // TODO: Initialize to an appropriate value
            PluginBase provider = null; // TODO: Initialize to an appropriate value
            object ID = null; // TODO: Initialize to an appropriate value
            Guid expected = new Guid(); // TODO: Initialize to an appropriate value
            Guid actual;
            actual = target.CreateUpdateThread(provider, ID);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
    }
}